/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.javanile.chesslang;

/**
 *
 * @author cicciodarkast
 */
public class Piece {
    private byte p;
    private byte v;
    public Piece(int piece) {
	p = (byte)(piece+6);
	v = (byte) piece;
    }
    public int directions() {
	return Stone.dir[p].length;
    }
    public int direction(int d) {
	return Stone.kid[Stone.dir[p][d]];
    }
    public int squares(int s, int d) {
	return Stone.map[Stone.dir[p][d]][s].length;
    }
    public int square(int s, int d, int i) {
	return Stone.map[Stone.dir[p][d]][s][i];
    }
    public byte value() {
	return v;
    }
}
